package com.bjtu.lms.action.system;

import com.bjtu.lms.service.SettingService;
import com.opensymphony.xwork2.ActionSupport;

public class SettingsAction extends ActionSupport {

	private int maxBorrow;
	private int maxDays;
	private SettingService settingService;
	private String result;

	public String getResult() {
		return result;
	}

	public void setResult(String result) {
		this.result = result;
	}

	public SettingService getSettingService() {
		return settingService;
	}

	public void setSettingService(SettingService settingService) {
		this.settingService = settingService;
	}

	public int getMaxBorrow() {
		return maxBorrow;
	}

	public void setMaxBorrow(int maxBorrow) {
		this.maxBorrow = maxBorrow;
	}

	public int getMaxDays() {
		return maxDays;
	}

	public void setMaxDays(int maxDays) {
		this.maxDays = maxDays;
	}

	@Override
	public String execute() throws Exception {
		result = settingService.setSetting(maxBorrow, maxDays);
		return SUCCESS;
	}
}
